<% if !@collection.challenge.signup_open %>

  <% if top && !@collection.potential_matches.empty? %>
    <ul class="navigation">
      <li>
        <%= link_to "Send Assignments", send_out_collection_assignments_path(@collection), :confirm => "Are you sure? This will send out the currently saved assignments to all participants!" %>
      </li>
    </ul>
    <div class="clear"></div>
  <% end %>
  
  <ul class="navigation">
    <% if @collection.potential_matches.empty? %>
      <li>
        <% if @settings.no_match_required? %>
          <%= link_to ts("Generate Potential Matches"), generate_collection_potential_matches_path(@collection),
                        :confirm => "Your challenge settings don't require any matching. Assignments will be completely random. Is this what you want?" %>
        <% else %>
          <%= link_to ts("Generate Potential Matches"), generate_collection_potential_matches_path(@collection) %>
        <% end %>
      </li>
    <% else %>
      <li><%= submit_tag ts("Save Assignment Changes") %></li>
      <li><%= link_to ts("Regenerate Assignments"), generate_collection_assignments_path(@collection),
                :confirm => ts("Are you sure? This will delete all current assignments.") %></li>
      <li><%= link_to ts("Regenerate Potential Matches"), generate_collection_potential_matches_path(@collection),
                 :confirm => ts("Are you sure? This will delete all current assignments and potential matches.") %></li>
    <% end %>
  </ul>  

  <% if !top && !@collection.potential_matches.empty? %>
    <div class="clear"></div>
    <ul class="navigation">
      <li>
        <%= link_to "Send Assignments", send_out_collection_assignments_path(@collection), :confirm => "Are you sure? This will send out the currently saved assignments to all participants!" %>
      </li>
    </ul>
  <% end %>

<% end %>
